<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void
    {
        Schema::create('freelancer_four_element_logs', function (Blueprint $table) {
            $table->id();
            $table->foreignId('freelancer_id')->constrained('freelancers')->comment('自由职业者ID');
            $table->json('request_payload')->comment('四要素请求数据');
            $table->json('response_payload')->nullable()->comment('四要素响应数据');
            $table->string('status', 32)->comment('验证结果状态');
            $table->string('message')->nullable()->comment('结果信息');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('freelancer_four_element_logs');
    }
};
